package com.practice.J2E.util.dto;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

/**
 * @author kayn
 * @create 2023-12-11 下午 02:10
 */
@Data
public class MainDataParam {


    @JSONField(name = "Head")
    private HeadDTO head;

    @JSONField(name = "Main")
    private MainDTO main;

    /**
     * 获取查询JSON
     * @param main
     * @return
     */
    public static String initQueryParamJSON(MainDTO main) {
        MainDataParam param = new MainDataParam();

        HeadDTO head = new HeadDTO();

        head.setAction("query");

        param.head = head;

        param.main = main;

        return JSONObject.toJSONString(param);
    }
}
